<extend name="Public/layout" />

<block name="content">
<section class="wrapper site-min-height">
    <!-- page start-->
    <section class="panel">
        <header class="panel-heading">
            短信日志
            <span class="pull-right">
                <!--<a href="{:U('Admin/SmsTemplate/add')}" class=" btn btn-success btn-xs">
                    <i class="fa fa-plus"></i> 新增
                </a>-->
                <button type="button" class="btn btn-warning btn-xs" onclick="window.location.reload()">
                    <i class="fa fa-refresh"></i> 刷新
                </button>
            </span>
        </header>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-12">
                    <form class="form-inline" role="form" action="{:U('Admin/SmsLog/index')}" method="get">
                        <div class="form-group">
                            <label class="sr-only" for="phone">手机号码</label>
                            手机号码 <input name="phone" value="{$Think.get.phone}" type="text" id="phone" class="form-control"  placeholder="请输入手机号码">
                        </div>
                        <div class="form-group">
                            日期
                            <input name="start_date" value="{$Think.get.start_date}" class="form-control" id="start_date" type="text" placeholder="请选择开始日期">-
                            <input name="end_date" value="{$Think.get.end_date}" class="form-control" id="end_date" type="text" placeholder="请选择结束日期">
                        </div>
                        <div class="form-group">
                            <label class="sr-only" for="type">类别</label>
                            类别
                            <select name="type" id="type" class="form-control">
                                <option value="">请选择</option>
                                <volist name="type_list" id="vl">
                                    <option value="{$vl.type}"
                                    <eq name="Think.get.type" value="$vl.type">
                                        selected='selected'
                                    </eq>
                                    >{$vl.title}
                                    </option>
                                </volist>
                            </select>
                        </div>
                        <div class="form-group">
                            <label class="sr-only" for="status">状态</label>
                            状态
                            <select name="status" id="status" class="form-control">
                                <option value="">请选择</option>
                                <option value="1" <eq name="Think.get.status" value="1">selected='selected'</eq>>成功</option>
                                <option value="2" <eq name="Think.get.status" value="2">selected='selected'</eq>>失败</option>
                                <option value="0" <eq name="Think.get.status" value="0">selected='selected'</eq>>处理中</option>
                            </select>
                        </div>
                        <button type="submit" class="btn btn-info">
                            <i class="fa fa-search"></i>
                            搜索
                        </button>
                    </form>
                </div>

            </div>
        </div>
        <hr style="margin:1px 0px; "/>
        <div class="panel-body">
            <div class="table-responsive" tabindex="1" style="overflow: hidden; outline: none;">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>手机号码</th>
                        <th>短信类型</th>
                        <th width="20%">短信内容</th>
                        <th>发送时间</th>
                        <th>发送类型</th>
                        <th>发送状态</th>
                        <th >操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <notempty name="list.list">

                    <volist name="list.list" id="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.phone}</td>
                        <td>{$vo.title}</td>
                        <td>{$vo.content}</td>
                        <td>
                            <notempty name="vo.send_time">
                                {$vo.send_time|date='Y-m-d H:i:s',###}
                                <else/>
                                —————————
                            </notempty>
                        </td>
                        <td>{$vo['is_auto']?'自动发送':'调度发送'}</td>
                        <td>
                            <switch name="vo.status" >
                                <case value="0">处理中</case>
                                <case value="1">发送成功</case>
                                <default />发送失败
                            </switch>
                        </td>
                        <td>
                            <a href="{:U('Admin/SmsLog/show')}?id={$vo.id}" class="btn btn-info btn-xs">
                                <i class="fa fa-eye"></i> 查看
                            </a>
                            <if condition="$vo.status eq 2">
                                <a href="javascript:;" ajax-msg="确认发送?" ajax-url="{:U('Admin/SmsLog/send')}?id={$vo.id}" class="btn btn-danger btn-xs ajax-action-btn">
                                    <i class="fa fa-mail-forward"></i> 发送
                                </a>
                            </if>
                        </td>
                    </tr>
                    </volist>
                        <else/>
                        <tr><td colspan="9" align="center">暂无数据</td></tr>
                    </notempty>
                    </tbody>
                </table>
            </div>
            <!--分页-->
            <div class="text-center">
                {$list.page}
            </div>
        </div>
    </section>
</section>
</block>

<block name="javascript">
    <script type="text/javascript" src="__ADMIN__/assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="__ADMIN__/assets/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
    <script>
    //菜单高
    MenuHighlight('{:U("Admin/SmsLog/index")}');
    //日期选择器
    $('#start_date,#end_date').datepicker();
    </script>

</block>

<block name="style">
    <link href="__ADMIN__/assets/bootstrap-datepicker/css/bootstrap-datepicker.css" rel="stylesheet" />
</block>
